package com.hmall.controller;


import com.hdmall.business.common.common.ServerResponse;
import com.hmall.service.RcvService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/*@RestController
@Api(value = "前后台回调API",description = "银联前后台回调")*/
public class RcvController {
    @PostMapping("frontRcvResponse")
    @ApiOperation(value = "前台回调")
    public void frontRcvResponse(HttpServletRequest req, HttpServletResponse resp)throws Exception{
        String respCode=RcvService.front(req,resp);
        resp.sendRedirect("http://mall.hdnylon.com/dist/view/result.html?respCode"+"="+respCode);
    }

    @RequestMapping("backRcvResponse")
    @ApiOperation(value = "后台回调")
    public void backRcvResponse(HttpServletRequest req, HttpServletResponse resp)throws Exception{
        RcvService.back(req,resp);
    }

}
